package com.flink.api.unit3;

import org.apache.flink.api.common.RuntimeExecutionMode;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * env_1
 *
 * @author caizhiyang
 * @since 2024-02-21
 */
public class env_mode_2 {

    public static void main(String[] args) {
        /**
         * 批处理模式使用
         */
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        //指定运行模式为批处理模式
        env.setRuntimeMode(RuntimeExecutionMode.BATCH);

        /**
         * 一般不在代码中指定,而是通过命令行运行jar包时指定,这样更灵活
         *  bin/flink run -Dexecution.runtime-mode=BATCH ...
         */
    }
}
